package com.itcoon.cloud.framework.transform.config;/**
 * @author Athric Yu
 * 2024/9/30
 **/

import com.itcoon.cloud.framework.transform.handler.TransformHandlerFactoryImpl;
import com.itcoon.cloud.framework.transform.TransformHandlerFactory;
import com.itcoon.cloud.framework.transform.converter.Converter;
import com.itcoon.cloud.framework.transform.converter.ConverterFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

import java.util.List;

/**
 *
 *
 * @author Athric Yu
 * 2024/9/30
 **/
@EnableConfigurationProperties(TransformConfigurationProperties.class)
public class TransformAutoConfiguration {

    @Bean
    public TransformHandlerFactory transformHandlerFactory(TransformConfigurationProperties properties){
        return new TransformHandlerFactoryImpl(properties);
    }

    @Bean
    public ConverterFactory converterFactory(List<Converter> converters){
        return new ConverterFactory(converters);
    }

}
